/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.asu.cse360.service.util;

import edu.asu.cse360.model.Chef;
import edu.asu.cse360.model.Employee;
import edu.asu.cse360.model.ItemOrder;
import edu.asu.cse360.model.WaitPerson;


public interface ItemOrderEmployeeAccessor {
    ItemOrderEmployeeAccessor WAIT_PERSON = new ItemOrderEmployeeAccessor() {
        @Override
        public Employee getEmployee(ItemOrder itemOrder) {
            return itemOrder.getWaitPerson();
        }

        @Override
        public void setEmployee(ItemOrder itemOrder, Employee employee) {
            itemOrder.setWaitPerson((WaitPerson)employee);
        }
    };

    ItemOrderEmployeeAccessor CHEF = new ItemOrderEmployeeAccessor() {
        @Override
        public Employee getEmployee(ItemOrder itemOrder) {
            return itemOrder.getChef();
        }

        @Override
        public void setEmployee(ItemOrder itemOrder, Employee employee) {
            itemOrder.setChef((Chef)employee);
        }
    };


    Employee getEmployee(ItemOrder itemOrder);

    void setEmployee(ItemOrder itemOrder, Employee employee);
}
